﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using DotNetNuke.Modules.mytargetmodule.Data;

namespace DotNetNuke.Modules.mytargetmodule.Components
{
    public class TaskController
    {
        public static void Deletetask(int Taskid)
        {
            DataProvider.Instance().daletetask(Taskid);
        }

        public static void DeleteTasks(int moduleId)
        {
            DataProvider.Instance().deletetasks(moduleId);
        }
        public static int savetask(Task t, int tabid)
        {
            if (t.TaskID==0)
            {
                t.TaskID = DataProvider.Instance().Addtask(t);
                var tax = new Taxanomy.Content();
                var objcontent = tax.CreateContentItem(t, tabid);
                t.ContentItemId = objcontent.ContentItemId;
                savetask(t, tabid);
            }
            else
            { 
              //
            }
            return t.TaskID;
        }
    }
}